package com.mew.user.controller;

import com.mew.common.dc.db.ProfileService;
import com.mew.common.enm.GoldProcessType;
import com.mew.common.entity.user.Profile;
import com.mew.common.entity.user.User;
import com.mew.common.exception.ResponseCode;
import com.mew.common.rest.user.UserDetailedInfoResponseMessage;
import com.mew.common.rest.user.VipInfoMessage;
import com.mew.user.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * @author dylin
 * @create 2021/1/27 0027
 */
@Controller
@RequestMapping("/profile")
public class ProfileController {

    @Autowired
    private ProfileService profileService;

    @ResponseBody
    @PostMapping("/addgold")
    public Profile addGold(@RequestParam("userId")long userId, @RequestParam("gold")long gold, @RequestParam("type")int type){

        return profileService.doGold(userId,gold, GoldProcessType.parse(type));
    }

}
